{template header}
<script src="js/admin.js"></script>
<script src="js/calendar.js"></script>
<script src="js/connSelectLocation.min.js"></script>
<div id="append">
</div>
<div class="outWrap">
	<div class="leftMenu">
		<ul>
			<li><h3><a href="index.php?c=user&a=default">个人资料</a></h3></li>
			<li class="on"><h3><a href="index.php?c=user&a=profile">资料设置</a></h3></li>
		<!-- 	<li><h3><a href="index.php?c=user&a=upimg">修改头像</a></h3></li> -->
			<li><h3><a href="index.php?c=user&a=uppass">修改密码</a></h3></li>
			<li><h3><a href="index.php?c=user&a=event">我的活动</a></h3></li>
			<!--{if 1==1 & $user['groupid']}-->
				<li><h3><a href="index.php?c=event&a=list">管理活动</a></h3></li>
			<!--{/if}-->
		</ul>
	</div>
	<div class="rightCont">
		<div class="userInfo">
		<h5>个人设置</h5>
        <div class="postForms border">
        	<form name="upinfoForm"  action="index.php?c=user&a=profile" method="post">
        	
        	
        	  <table cellspacing="3" cellpadding="3" width="96%">
                       <tr>
                <td class="tdLeft"><span style="color:red;">*</span>真实姓名：</td>
                <td class="tdRight">
                	<input maxlength="12" name="truename"  class="txt" type="text" value="{$user['truename']}" />
                	<span class="gray">限制在2-4个汉字字符，不能是英文，数字等。</span>
                </td>
              </tr>
			   <tr>
                <td class="tdLeft"><span style="color:red;">*</span>性&nbsp;&nbsp;&nbsp;别：</td>
                <td class="tdRight">
                	<input id="gender1" name="gender" type="radio"  {if 1==$user['gender'] }checked{/if}  value="1" /><label for="gender1">男</label>
                	<input id="gender2" name="gender" type="radio"  {if 0==$user['gender'] }checked{/if}  value="0" /><label for="gender2">女</label>
                </td>
              </tr>
              <tr>
                <td class="tdLeft"><span style="color:red;">*</span>生&nbsp;&nbsp;&nbsp;日：</td>
                <td class="tdRight">
                	<input class="txt" value="{$user['bday']}" id="bday" name="bday" readonly  onclick="showcalendar();" value="{$user['bday']}" />
                </td>
              </tr>
              
			   <tr>
                <td class="tdLeft"><span style="color:red;">*</span>手机号码：</td>
                <td class="tdRight"><input maxlength="12" name="mobile"   class="txt" type="text" value="{$user['mobile']}"/></td>
              </tr>
			   <tr>
                <td class="tdLeft"><span style="color:red;">*</span>Email：</td>
                <td class="tdRight">
                	<input maxlength="32" name="email" class="txt" type="text" value="{$user['email']}" />
                	<span class="gray">请输入常用邮箱，通过验证后可用于登录和找回密码。</span>
                </td>
              </tr>
              
              
		   <tr>
                <td class="tdLeft"><span style="color:red;">*</span>婚姻状况：</td>
                <td class="tdRight">
                	<input id="idtype1" name="marrytype" type="radio"   {if 1==$user['marrytype'] }checked{/if}   value="1"/><label for="idtype1">未婚</label>
                	<input id="idtype2" name="marrytype" type="radio"   {if 2==$user['marrytype'] }checked{/if}  value="2"/><label for="idtype2">已婚</label>
                	<input id="idtype3" name="marrytype" type="radio"   {if 3==$user['marrytype'] }checked{/if}  value="3"/><label for="idtype3">离异</label>
                	<input id="idtype3" name="marrytype" type="radio"   {if 4==$user['marrytype'] }checked{/if}  value="4"/><label for="idtype3">重组家庭</label>
                </td>
              </tr>
              



               <tr>
                <td class="tdLeft"><span style="color:red;">*</span>爱人姓名：</td>
                <td class="tdRight">
                	<input maxlength="12" name="lovertruename"  class="txt" type="text" value="{$user['lovertruename']}" />
                	<span class="gray">限制在2-4个汉字字符，不能是英文，数字等。</span>
                </td>
              </tr>
              <tr>
                <td class="tdLeft"><span style="color:red;">*</span>爱人生日：</td>
                <td class="tdRight">
                	<input class="txt" value="{$user['loverbday']}" id="loverbday" name="loverbday" readonly  onclick="showcalendar();" value="{$user['loverbday']}" />
                </td>
              </tr>
              
			   <tr>
                <td class="tdLeft"><span style="color:red;">*</span>爱人手机号码：</td>
                <td class="tdRight"><input maxlength="12" name="lovermobile"   class="txt" type="text" value="{$user['lovermobile']}"/></td>
              </tr>
			   <tr>
                <td class="tdLeft"><span style="color:red;">*</span>爱人Email：</td>
                <td class="tdRight">
                	<input maxlength="32" name="loveremail" class="txt" type="text" value="{$user['loveremail']}" />
                </td>
              </tr>
              

<!--{loop $user['childtruename'] $index $childtruename}-->	
             <tr>
                <td class="tdLeft"><span style="color:red;">*</span>孩子姓名：</td>
                <td class="tdRight">
                	<input maxlength="12" name="childtruename[]"  class="txt" type="text" value="{$user['childtruename'][$index]}" />
                	性别：<select  name="childgender[]">
			                	<option {if '1'==$user['childgender'][$index] }selected{/if} value="1">男</option>
			                	<option {if '2'==$user['childgender'][$index] }selected{/if} value="2">女</option>
		                	</select>
                	生日：<input class="txt"  name="childbday[]" readonly  onclick="showcalendar();"  value="{$user['childbday'][$index]}"  />
                </td>
              </tr>
<!--{/loop}-->
            
		   <tr  id="morechild">
                	 <td>&nbsp;</td>
               	 <td ><input class="btn"  type="button" value="添加孩子..." onclick="javascript:addchild();" /></td>
              </tr>
              
              

		   <tr>
                <td class="tdLeft">固定电话：</td>
                <td class="tdRight"><input maxlength="12" name="phone"   class="txt" type="text" value="{$user['phone']}"/></td>
              </tr>
			   <tr>
                <td class="tdLeft">证件类型：</td>
                <td class="tdRight">
                	<input id="idtype1" name="idtype" type="radio"   {if 1==$user['idtype'] }checked{/if}   value="1"/><label for="idtype1">身份证</label>
                	<input id="idtype2" name="idtype" type="radio"   {if 2==$user['idtype'] }checked{/if}  value="2"/><label for="idtype2">护照</label>
                	<input id="idtype3" name="idtype" type="radio"   {if 3==$user['idtype'] }checked{/if}  value="3"/><label for="idtype3">驾驶证</label>
                </td>
              </tr>
			   <tr>
                <td class="tdLeft">证件号码：</td>
                <td class="tdRight">
                	<input maxlength="18" name="idno"  class="txt" type="text"  value="{$user['idno']}"/>
                </td>
              </tr>
			   <tr>
                <td colspan="2" height="18px"></td>
              </tr>
		<tr>
                <td class="tdLeft">现居住地：</td>
                <td class="tdRight"  id='conn-location-1' >
				<select id='conn-province'  name="province"><option value='0'>请选择</option></select>
				<select id='conn-city'  name="city"><option value='0'>请选择</option></select>
				<select id='conn-district'  name="district"><option value='0'>请选择</option></select>
				<br />
				<input type="text" id="address" name="address" class="txt350" maxlength="50" value="{$user['address']}" />
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 邮编：</td>
                <td class="tdRight">
                	<input maxlength="18" name="postcode"  class="txt" type="text"  value="{$user['postcode']}"/>
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 毕业学校：</td>
                <td class="tdRight">
                	<input maxlength="32"  name="school"  class="txt350" type="text"  value="{$user['school']}"  />
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 学历：</td>
                <td class="tdRight">
					<input  name="educationtype" type="radio"   {if 1==$user['educationtype'] }checked{/if}   value="1"/><label>博士后</label>
	                	<input  name="educationtype" type="radio"   {if 2==$user['educationtype'] }checked{/if}  value="2"/><label>博士</label>
	                	<input  name="educationtype" type="radio"   {if 3==$user['educationtype'] }checked{/if}  value="3"/><label>硕士</label>
	                	<input  name="educationtype" type="radio"   {if 4==$user['educationtype'] }checked{/if}   value="4"/><label>本科</label>
	                	<input  name="educationtype" type="radio"   {if 5==$user['educationtype'] }checked{/if}  value="5"/><label>专科</label>
	                	<input  name="educationtype" type="radio"   {if 6==$user['educationtype'] }checked{/if}  value="6"/><label>中学</label>
	                	<input  name="educationtype" type="radio"   {if 7==$user['educationtype'] }checked{/if}   value="7"/><label>其它</label>
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 工作单位：</td>
                <td class="tdRight">
                	<input maxlength="32"  name="company"  class="txt350" type="text"  value="{$user['company']}"  />
                </td>
              </tr> 
		   <tr>
                <td class="tdLeft"> 职业：</td>
                <td class="tdRight">
                	<input maxlength="18" name="jobskill"  class="txt" type="text"  value="{$user['jobskill']}"/>
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 职位：</td>
                <td class="tdRight">
                	<input maxlength="18" name="jobtitle"  class="txt" type="text"  value="{$user['jobtitle']}"/>
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 年收入：</td>
                <td class="tdRight">
                	<input maxlength="18" name="income"  class="txt" type="text"  value="{$user['income']}"/>元。
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 血型：</td>
                <td class="tdRight">
					<input  name="bloodtype" type="radio"   {if 1==$user['bloodtype'] }checked{/if}   value="1"/><label>A</label>
	                	<input  name="bloodtype" type="radio"   {if 2==$user['bloodtype'] }checked{/if}  value="2"/><label>B</label>
	                	<input  name="bloodtype" type="radio"   {if 3==$user['bloodtype'] }checked{/if}  value="3"/><label>AB</label>
	                	<input  name="bloodtype" type="radio"   {if 4==$user['bloodtype'] }checked{/if}   value="4"/><label>O</label>
	                	<input  name="bloodtype" type="radio"   {if 5==$user['bloodtype'] }checked{/if}  value="5"/><label>其它</label>
                </td>
              </tr>
		   <tr>
                <td class="tdLeft"> 性格测试：</td>
                <td class="tdRight">
					<input  name="charactertype" type="radio"   {if 1==$user['charactertype'] }checked{/if}   value="1"/><label>D</label>
	                	<input  name="charactertype" type="radio"   {if 2==$user['charactertype'] }checked{/if}  value="2"/><label>I</label>
	                	<input  name="charactertype" type="radio"   {if 3==$user['charactertype'] }checked{/if}  value="3"/><label>S</label>
	                	<input  name="charactertype" type="radio"   {if 4==$user['charactertype'] }checked{/if}   value="4"/><label>C</label>
	                	<input  name="charactertype" type="radio"   {if 5==$user['charactertype'] }checked{/if}  value="5"/><label>未知</label>
                </td>
              </tr>
              <tr>
                <td>支付宝:</td>
                <td><input maxlength="12" name="alipay" value="{$user['alipay']}" class="txt" type="text" ></td>
              </tr>
              <tr>
              <tr>
                <td>QQ 号:</td>
                <td><input maxlength="12" name="qq" value="{$user['qq']}" class="txt" type="text" ></td>
              </tr>
              <tr>
                <td>MSN :</td>
                <td><input maxlength="40" name="msn" value="{$user['msn']}" class="txt" type="text" ></td>
              </tr>
              <tr>
                <td>阿里旺旺 :</td>
                <td><input maxlength="40" name="aliwang" value="{$user['aliwang']}" class="txt" type="text" ></td>
              </tr>
              <tr>
                <td>个人主页 :</td>
                <td><input maxlength="40" name="homepage" value="{$user['homepage']}" class="txt350" type="text" ></td>
              </tr>
              <tr>
                <td>兴趣爱好 :</td>
                <td><input maxlength="40" name="hobby" value="{$user['hobby']}" class="txt350" type="text" ></td>
              </tr>
              <tr>
                <td>个人情况简介:</td>
                <td><textarea name="signature" id="signature"  rows="6" cols="50">{$user['signature']}</textarea></td>
              </tr>
<!--{loop $fieldlist $field}-->
<tr>
	 <td>$field['title']:</td>
	 <td>
	 <!--{if 'text'==$field['type']}-->
	 	<input maxlength="$field['maxlength']" name="$field['name']"  value="{$user[$field['name']]}"  id="$field['name']"  class="txt350" type="text" >
	 <!--{/if}-->
	 <!--{if 'multitext'==$field['type']}-->
		<textarea name="$field['name']" id="$field['name']"  rows="6" cols="50">{$user[$field['name']]}</textarea>
	 <!--{/if}-->
	 <!--{if 'datetime'==$field['type']}-->
	 	<input readonly  onclick="showcalendar();"  name="$field['name']" id="$field['name']" value="{$user[$field['name']]}" class="txt" type="text" >
	 <!--{/if}-->
	 <!--{if 'address'==$field['type']}-->
	 	暂时不好处理
	 <!--{/if}-->
	 <!--{if 'select'==$field['type']}-->
    	<select  name="$field['name']">
    		<!--{loop $field['defaults'] $index $option}-->
             		<option {if $index==$user[$field['name']] }selected{/if} value="$index">{$option}</option>
             	<!--{/loop}-->
		</select>
	 <!--{/if}-->
	 <!--{if 'radio'==$field['type']}-->
 		<!--{loop $field['defaults'] $index $radio}-->
				<input  name="$field['name']" type="radio"   {if $index==$user[$field['name']] }checked{/if}   value="$index"/><label>{$radio}</label>
	     <!--{/loop}-->
	 <!--{/if}-->
	 <!--{if 'checkbox'==$field['type']}-->
		<!--{loop $field['defaults'] $index $check}-->
	 		<input name="{$field['name']}[]"   type="checkbox"  {if @in_array($index , $user[$field['name']])}checked{/if}   value="{$index}" ><label>{$check}</label>
	     <!--{/loop}-->
	 <!--{/if}-->
	 </td>
</tr>
<!--{/loop}-->
              <tr>
                <td>&nbsp;</td>
                <td><input type="submit" name="submit" value="提 交" class="btn"></td>
              </tr>
            </tbody></table>
          </form>
      </div>
	</div>
</div>
<script type="text/javascript">
function areaCallBack() {
  $('#conn-location-1').next().html('');
}

$( function(){
  
  	$('#conn-location-1').connectSelectLocation({
		type:'normal',
		data:'js/location.js',
		select1:$('#conn-province'),
		select2:$('#conn-city'),
		select3:$('#conn-district'),
		current:[ $user['province'],$user['city'],$user['district'] ],
		fun1:function() { areaCallBack(); },
		fun2:function() { areaCallBack(); },
		fun3:function() { areaCallBack(); },
		callelement:$('#hdAddress'),
		space:[6,6,3]
    }); 
    
    //$('tr[id^="guard"]').hide();
    //checkadult();
   //    addchild();

});

function checkadult(){
	$.get("index.php?c=user&a=ajaxadult&bday="+$('#bday').val(), function(isadult){
	   if(0==isadult){
	   	  $('tr[id^="guard"]').show();
	   }else{
	        $('tr[id^="guard"]').hide();
	   }
	}); 
}

function addchild(){
	var html='<tr><td class="tdLeft"><span style="color:red;">*</span>孩子姓名：</td><td class="tdRight"><input maxlength="12" name="childtruename[]"  class="txt" type="text" value="" />性别：<select  name="childgender[]"><option value="1">男</option><option value="2">女</option></select>生日：<input class="txt"  name="childbday[]" readonly  onclick="showcalendar();"  value=""  /></td></tr>';
	$(html).insertBefore('#morechild');
}
</script>
{template footer}